window.addEventListener('load',function(){
    // 发展历程内容 滚动部分
    var divs = document.querySelector('.year_page');
    var ulss = divs.querySelector('.swiper-wrappers');
    var lis = ulss.querySelectorAll('.scroll_page');

   var active0 = document.querySelector('.active0');
   var active1 = document.querySelector('.active1');
   var active2 = document.querySelector('.active2');
   var active = document.querySelector('.active');
   ulss.style.transform = `translateX(-4410px)`;
   function getPage(active,obj) {  
       for (var i = 0; i < lis.length; i++) { 
           var li = obj.offsetLeft;
           console.log(li);
           var divsX = divs.offsetLeft; 
           var move = li -  divsX ;

           if (obj == lis[lis.length - 2]) {
            move = 4410;
        } else if (obj == lis[0]) {
            move = 0;
        }
           Move(active, move); 
           function Move(active, move){ 
            active.addEventListener('click',function(){
            ulss.style.transition = 'all .8s';
            ulss.style.transform = `translateX(-${move}px)`;
               })
           }
       } 
   }
   getPage(active0, lis[0]); 
   getPage(active1, lis[2]);
   getPage(active2, lis[6]);
   getPage(active, lis[10]); 
})
  